{% extends "base.html" %}
{% from "_helpers.html" import render_field %}
{% from "_helpers.html" import paginator %}

{% block title %}Reports{% endblock %}

{% block body %}
<div class="row">
    <div class="col-md-12">
      <div id="report-filter" class="well">
        <form class="form-inline" method="GET">
            {{ render_field(filter_form.opsysreleases, class="multiselect") }}
            {{ render_field(filter_form.component_names, placeholder="Components", class="component-names") }}
            {{ render_field(filter_form.associate, class="multiselect-filtered-dynamic hidden") }}
            {{ render_field(filter_form.arch, class="multiselect") }}
            {{ render_field(filter_form.type, class="multiselect") }}
            <div class="showlabel separated">
                <div>
                    <label for="solution" style="margin-right: 10px;">Solution</label>
                    {{ filter_form.solution }}
                </div>
              <div>
              {{ render_field(filter_form.daterange, class="form-control daterange") }}
              </div>
              <div>
              {{ render_field(filter_form.order_by) }}
              <button class="btn btn-primary" type="submit">Query</button>
              </div>
            </div>
        </form>
      </div>
      <div id="report-list">
        <table class="table table-striped table-bordered table-condensed">
          <thead>
            <tr>
                <th>ID</th>
                <th>Component</th>
                <th>Crash function</th>
                <th>Status</th>
                <th>Type</th>
                <th>Last occurrence</th>
                <th>First occurrence</th>
                <th>Count</th>
            </tr>
          </thead>
                {% if list_table_rows %}
                  {{list_table_rows|safe}}
                {% else %}
                  {% include "reports/list_table_rows.html" with context %}
                {% endif %}
        </table>
      </div>
    </div>
    <div class="col-md-12">
        {{ paginator(pagination, report_count) }}
    </div>
</div>
{% endblock %}
